

class Dog {

    private String name;

    public int age;

    public Dog(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void eat() {
        System.out.println(this.name + "吃东西");
    }
    public void wag() {
        System.out.println(this.name + "摇尾巴");
    }
}
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("旺财",3);
        dog.name = "小黄";
        System.out.println(dog.name);

    }
}
/*
abstract class a {
    public abstract void www();
}
abstract  class Shape {
    public int age;
    public String name;

    public Shape(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public void eat() {
        ;
    }

    public abstract void draw();
    public abstract void www();
}
*/
/* abstract class b extends Shape {


 }*//*


class Rect extends Shape {
    public  void draw() {
        System.out.println("画举行");
    }
   public void www() {
       System.out.println("www");
   }
   public Rect() {
        super(12,"www");
   }
}
class Cycle  {
    public void draw() {
        System.out.println("画圆");
    }
    public void www() {
        System.out.println("www");
    }
}

public class Test {
    public static void func(Shape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
       // func(new Cycle());
        func(new Rect());

        //Shape shape = new Shape();

    }


}
*/
